home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 38
/
Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso
/
-seriously_amiga-
/
misc
/
felix
/
source
/
flxclasses.h
< prev
next >
Wrap
C/C++ Source or Header
|
1999-01-25
|
3KB
|
105 lines
//*************************************************************************//
// Filename: mzclasses.h
// Autor: Christian Taulien of Strange Intelligence
// Purpose: definition of used classes
// Creation: 18. März 1998
//*************************************************************************//
#ifndef FLXCLASSES_H
#define FLXCLASSES_H
#include "funcs.h"
#include <exec/types.h>
#include <exec/nodes.h>
#include <exec/lists.h>
#include <dos/notify.h>
// *** Flag definitions
#define FLXFLAG_INACTIVE (1L<<0) // set if the watch is disabled
#define FLXFLAG_HIDDEN (1L<<1) // set if the textwindow is hidden
#define FLXFLAG_MODIFIED (1L<<2) // set if the file was modified
#define FLXFLAG_PROCESSED (1L<<31) // used in checkAccess()
#define FLXMASK_DEFAULT 0
#define SIFC_SETBIT(dest, flag, bitmask)\
dest = (flag) ? (dest) | (bitmask) : (dest) & ~(bitmask);
extern char *createNameFromInstance(void);
class FLXWatchListC;
//*************************************************************************//
//.klasse
//KLASSENNAME : FLXNodeC
//VERSION : 18. März 1998
//AUTOR : Taulien
//AUFGABE : Eine Klasse zur Verwaltung eines Watches
//DOKUMENTATION : -
//BEMERKUNGEN : -
//AENDERUNGEN : -
//*************************************************************************//
class FLXNodeC : public struct Node
{
friend class FLXWatchListC;
private:
// ## datamembers
ULONG m_ulFlags; // see FLXFLAG_#? flags above
// ## methods
FLXNodeC(struct APIInstance *arg_poInstance, FLXWatchListC *arg_poWatchList);
void setProcessed(BOOL arg_bFlag) { SIFC_SETBIT(m_ulFlags, arg_bFlag, FLXFLAG_PROCESSED); };
BOOL isProcessed(void) const { return m_ulFlags & FLXFLAG_PROCESSED; };
public:
// ## datamebers
struct APIInstance *m_poAPIInstance; // to recognize the msg
struct NotifyRequest *m_poNotifyReq; // for the
// ## methods
~FLXNodeC();
void setInactive(BOOL arg_bFlag) { SIFC_SETBIT(m_ulFlags, arg_bFlag, FLXFLAG_INACTIVE); };
void setHidden(BOOL arg_bFlag) { SIFC_SETBIT(m_ulFlags, arg_bFlag, FLXFLAG_HIDDEN); };
void setModified(BOOL arg_bFlag) { SIFC_SETBIT(m_ulFlags, arg_bFlag, FLXFLAG_MODIFIED); };
BOOL isInactive(void) const { return m_ulFlags & FLXFLAG_INACTIVE; };
BOOL isHidden (void) const { return m_ulFlags & FLXFLAG_HIDDEN; };
BOOL isModified(void) const { return m_ulFlags & FLXFLAG_MODIFIED; };
char *getFileName(void) { return ln_Name; };
FLXNodeC *getNext(void);
FLXNodeC *getPrev(void);
void reloadFile(void);
};
//*************************************************************************//
//.klasse
//KLASSENNAME : FLXWatchListC
//VERSION : 18. März 1998
//AUTOR : Taulien
//AUFGABE : Eine Klasse für die Verwaltung der Watches
//DOKUMENTATION : -
//BEMERKUNGEN : -
//AENDERUNGEN : -
//*************************************************************************//
class FLXWatchListC : public struct List
{
private:
struct MsgPort *m_poMsgPort;
public:
FLXWatchListC();
~FLXWatchListC();
struct MsgPort *getMsgPort(void) { return m_poMsgPort; };
BOOL addWatch (struct APIInstance *arg_poInstance);
FLXNodeC *findWatch(struct APIInstance *arg_poInstance);
FLXNodeC *getFirst(void) { return (FLXNodeC *) lh_Head; };
int getSize(void);
void checkAccess(void);
FLXNodeC *operator[](int arg_iIndex);
};
#endif // FLXCLASSES_H